package com.solocredit.finance.ui.splash.impl

import com.solocredit.finance.config.MullaConfigs
import com.solocredit.finance.http.ApiService
import com.solocredit.finance.http.HttpHelper
import com.solocredit.finance.http.IHttpCallback
import com.solocredit.finance.utils.okhttp.model.HttpParams
import org.json.JSONObject
import java.util.TimeZone

/**
 * MullaFlow
 * @Author wwdeng
 * @CreateTime: 2024/7/25 13:39
 * @Annotation：Model层  接口实现类
 */
class MullaSplashModelImpl{

    /**
     * 获取地区转发
     */
    fun loadMullaTimeZoneAction(callBack: IHttpCallback) {
        val params = HttpParams()
        params.put("p", MullaConfigs.MULLA_APPNAME)
        params.put("tz", TimeZone.getDefault().id)
        val httpUrl = ApiService.MULLA_BASE_URL + ApiService.API_URL.MULLA_API_TIMEZONE_URL+"?p=${MullaConfigs.MULLA_APPNAME}&tz=${TimeZone.getDefault().id}"
        HttpHelper.getMullaAction(httpUrl,params,callBack)
    }

    /**
     * 获取APP配置信息
     */
    fun loadMullaCommonConfigAction(callBack: IHttpCallback) {
        val params = JSONObject().apply {
            put("product",MullaConfigs.MULLA_APPNAME)
        }
        val httpUrl = ApiService.getHttpUrl(ApiService.API_PATH.MULLA_API_APP_INFO_PATH)
        HttpHelper.postMullaAction(httpUrl,params,callBack)
    }
}